<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--jstl을 쓰기 위해 사용 --%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%--숫자 포맷을 사용하기 위해 사용 --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%><%--함수들을 이용하기 위해 사용 --%>
<%@ taglib prefix="c-rt" uri="http://java.sun.com/jstl/core_rt" %>  <%-- ie버전 확인에 쓰기 위해 씀 --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<!--<script type="text/javascript" src="script/sms_riskI_script.js"></script>-->
</head>
<body>
<div class="box">
      		<h4 class="white">
      			<span class="align-left">위협목록작성</span>
	      		<span class="align-right">마감상태(위험식별) :
		      		<c:choose>
		      			<c:when test="${sessionScope.magamSession[2].state =='Y'}">
		      				 마감
		      			</c:when>
		      			<c:otherwise>
		      				 착수
		      			</c:otherwise>
		      		</c:choose>
	      		</span>
      		</h4>
        <div class="box-container1">     		
        	<table class="table-long">
      			<tfoot>
      				<tr>
      					<td>
      					<%--
      					<div class="align-left">&nbsp;&nbsp;
	   						<a href="#" class="button1"><span>위협유형</span></a>&nbsp;&nbsp;
   							<select name="base_lev1" id="base_lev1" class="selectBox" onchange="search_mtlist_base_lev1(this)" style="width: 200px;">
   								<option value="0"> - 전체 - </option>
								<c:forEach  var="list" items="${requestScope.distinctList}" varStatus="status">
									<option <c:if test="${list.base_lev1 == requestScope.base_lev1 }">selected</c:if> value="${list.base_lev1 }">${list.tk_nm1 }</option>
								</c:forEach>
							</select>
   						</div>
   						 --%>	
   						 <div class="align-left"><a href="#" class="button1 firstButton"><span style="font-size: small; font-weight:normal;">전체 : ${fn:length(list)}</span></a></div>

      					<div class="align-right"><!--select class="form-select"><option value="option1">Bulk Options</option>
      					<option value="option2">Delete All</option></select-->
                      			<a href="riskIAction.do?mode=exmtlist&searchText=${param.searchText }" class="button"><span>엑셀</span></a> 
      						<c:choose>
	                       		<c:when test="${sessionScope.magamSession[2].state !='Y'}">
	                       		<!-- 마감 현황이 유무 판별(Y 시 입력 불가) -->
	                       			<%--<a href="#" class="button" onclick="javascript: openTkList()"><span>생성</span></a> --%>
	                       			<a href="#" class="button" onclick="javascript: mtkind_insertPage()"><span>생성</span></a>
      								<a href="#" class="button" onclick="javascript: riskIDelete()"><span>삭제</span></a>
	                       		</c:when>
	                       		<c:otherwise>	
	                       			<a href="#" class="button1 addMargin" onclick="return false;"><span>생성</span></a>
	      							<a href="#" class="button1 addMargin" onclick="return false;"><span>삭제</span></a>
	                       		</c:otherwise>
	                       	</c:choose>
      					</div>
      					
      					 <!-- 검색 -->
      						<div class="align-right" style="margin-right: 85px">
	      						<span style="width: 22px; height: 22px; background: url('img/icon-view-info.gif') no-repeat scroll right center transparent;  overflow: hidden;display:inline-block;"></span>
	      						<span style="vertical-align: top"><input name="searchText" type="text" id="searchText" style="width:140px;" value="${param.searchText }" /></span>
	      						<span><a href="#" class="button rightNoMargin verticTop" onclick="searchText('mtlist')"><span>조회</span></a></span>
      						</div>
      					</td>
      				</tr>
      				<tr><td class="spaceLine"></td></tr>
      			</tfoot>
      		</table>
        	<form name="riskIDelForm" action="riskIAction.do" method="post">
        	<input type="hidden" name="mode" value="mtkind_delete"></input>
        	<input type="hidden" name="pro_id" value="${sessionScope.lastProId }"></input>
      		<table class="table-long">
      			<colgroup>
				<c-rt:choose>
					<c-rt:when test="${isMSIE67}">
						<col width="51px"/>
						<col width="76px"/>
						<col width="76px"/>
						<col width="76px"/>
						<col width="76px"/>
						<col width="18px"/>
						<col width="30px"/>
						<col width="45px"/>
						<col width="45px"/>
						<col width="70px"/>
						<col/>
						<col width="15px"/>
					</c-rt:when>
					<c-rt:otherwise>
						<col width="50px"/>
						<col width="85px"/>
						<col width="85px"/>
						<col width="85px"/>
						<col width="85px"/>
						<col width="25px"/>
						<col width="25px"/>
						<col width="50px"/>
						<col width="50px"/>
						<col width="70px"/>
						<col/>
						<col width="15px"/>
					</c-rt:otherwise>
				</c-rt:choose>
			</colgroup>
      			<thead>
      				<tr>
      					<td class="col-chk " rowspan="2"><input type='checkbox' name='checkAll' onclick="javascript: selectAll()"  class="chkCursor"></input></td>
      					<td class="col-rowspanMid" rowspan="2">위협유형</td>
      					<td class="col-rowspanMid" rowspan="2">위협명</td>
      					<td class="col-rowspanMid" rowspan="2">상세위협명</td>
      					<td class="col-rowspanMid" rowspan="2">위협공격자</td>
      					<td colspan="3" style="padding-left: 10px">위협원천</td>
      					<td class="col-rowspanMid" rowspan="2">위협<br/>동기</td>
      					<td class="col-rowspanMid" rowspan="2">연관<br/>자산유형</td>
      					<td class="col-rowspanMid" rowspan="2">위협결과</td>
      					<td rowspan="2"></td>
      				</tr>
      				<tr>
      					<td style="padding-left: 3px">D</td>
      					<td style="padding-left: 3px">A</td>
      					<td style="padding-left: 3px">E</td>
      				</tr>
      			</thead>
      		</table>
      		<div class="scrollDIV">
      		<table class="table-long">
      			<colgroup>
				<c-rt:choose>
					<c-rt:when test="${isMSIE67}">
						<col width="51px"/>
						<col width="76px"/>
						<col width="76px"/>
						<col width="76px"/>
						<col width="76px"/>
						<col width="26px"/>
						<col width="26px"/>
						<col width="41px"/>
						<col width="41px"/>
						<col width="70px"/>
						<col/>
						<col width="15px"/>
					</c-rt:when>
					<c-rt:otherwise>
						<col width="50px"/>
						<col width="85px"/>
						<col width="85px"/>
						<col width="85px"/>
						<col width="85px"/>
						<col width="25px"/>
						<col width="25px"/>
						<col width="50px"/>
						<col width="50px"/>
						<col width="70px"/>
						<col/>
						<col width="15px"/>
					</c-rt:otherwise>
				</c-rt:choose>
			</colgroup>
      			<tbody>
      				<c:choose>
                    	<c:when test="${fn:length(list)!= 0}">
                       	<c:forEach var="list" items="${requestScope.list}" varStatus="status">
                   			<%--
                   			<tr onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');" class="odd">
                   			 --%>
                   			  <tr <c:if test="${status.index%2==0 }">class="odd"</c:if> onmouseover="ChangeBackground(this,'over','${status.index}');" onmouseout="ChangeBackground(this,'out','${status.index}');">
                    			<td class="col-chk"><input type="checkbox" name="check" id="check${status.index+1 }"  class="chkCursor" value='${list.tk_id }'></input></td>
                    			<td> 
                    				<div class="ellipsis"  style="width:100%;" title="${list.tk_nm1}">${list.tk_nm1}</div>
                    			</td>
                    			<td> 
                    				<div class="ellipsis"  style="width:100%;"><a href="riskIAction.do?mode=mtlist_updatePage&tl_id=${list.tl_id }" class="nor ellipsis" title='${list.tk_nm2 }'>${list.tk_nm2 }</a></div>
                    			</td>
                    			<td> 
               						<div class="ellipsis"  style="width:100%;" title="${list.tk_nm3}">${list.tk_nm3}</div>
                    			</td>
                    			<td> 
                    				<div class="ellipsis"  style="width:100%;" title="${list.tl_attack}">${list.tl_attack}</div>
                    			</td>
                    			<td>
                    				<c:choose>
	                    				<c:when test="${list.tk_d==1 }">
	                    					<img src="img/chkok.gif"></img>
	                    				</c:when>
	                    				<c:otherwise>
	                    					<img src="img/chkno.gif"></img>
	                    				</c:otherwise>
                    				</c:choose>
                    			</td>
                    			<td>
                    				<c:choose>
	                    				<c:when test="${list.tk_a==1 }">
	                    					<img src="img/chkok.gif"></img>
	                    				</c:when>
	                    				<c:otherwise>
	                    					<img src="img/chkno.gif"></img>
	                    				</c:otherwise>
                    				</c:choose>
                    			</td>
                    			<td>
                    				<c:choose>
	                    				<c:when test="${list.tk_e==1 }">
	                    					<img src="img/chkok.gif"></img>
	                    				</c:when>
	                    				<c:otherwise>
	                    					<img src="img/chkno.gif"></img>
	                    				</c:otherwise>
                    				</c:choose>
                    			</td>
                    			<td> 
                    				<div class="ellipsis"  style="width:100%;"  title="${list.tl_motive}">${list.tl_motive}</div> 
                    			</td>
                    			<td>
                    				<c:choose>
	                    				<c:when test="${list.acnt==0 }">
	                    					<a class="button1" style="margin: 0"><span>${list.acnt }</span></a>
	                    				</c:when>
	                    				<c:otherwise>
	                    					<a href="#" class="button" style="margin: 0" onclick="t_akind_popup('${list.pro_id }','${list.base_lev1 }','${list.base_lev2 }','${list.base_lev3 }')"><span>${list.acnt }</span></a>
	                    				</c:otherwise>
                    				</c:choose> 
                    			</td>
                    			<td>
                    				<div class="ellipsis" style="width:100%;" title="${list.tl_result }">${list.tl_result }</div>
                    			</td>
	   					 	<td></td>
                    		</tr>
                    	</c:forEach>
                    	</c:when>
                    	<c:otherwise>
                    		<tr class="odd">
								<td colspan="11"  class="noDataTD">-데이터가 없습니다-</td>
							</tr>
                    	</c:otherwise>
                    	</c:choose>
      			</tbody>
      		</table>  	
      		</div>
      		</form>
      	</div><!-- end of div.box-container1 -->
      	</div> <!-- end of div.box -->
</body>
</html>